<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页</title>
    <!-- Bootstrap -->
    <link href="{SHUAFEN_STATICS_PATH}css/bootstrap.min.css" rel="stylesheet">
    <link href="{SHUAFEN_STATICS_PATH}css/profile_style.css" rel="stylesheet">
    <link href="{SHUAFEN_STATICS_PATH}css/response.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
   <script src="{SHUAFEN_STATICS_PATH}js/lib/jquery.min.js"></script>
   <script type="text/javascript">
    $(function (){

    });
 	// 我要排队
	function lineup(){
		$.ajax({
			url : 'index.php?m=shuafen&c=web&a=passivityAdd&t='+(new Date()).getTime(),
			success : function (rs){
				if(rs.status!=true){
					$("#modelText").text(rs.msg);
					$('#myModal').modal();
				}else{
					window.location = '/index.php?m=shuafen&c=web'
				}
			},
			dataType : 'json'
		});
	}
  </script>
  </head>
  <body>
  	<p class="bg-primary" style="padding: 15px;font-weight: bold;font-size: 18px;">{$tips[tip_name]}</p>
    <div id="sliderA" class="slider">
		<?php foreach($carousel as $v){ ?>
		<img class='ad'  src='<?php echo $v["image_url"] ?>' />
		<?php } ?>
		<!--<img class='ad'  src='{SHUAFEN_STATICS_PATH}images/index02.jpg' />-->
    </div><!--slider/-->

    <div class="login-reg" style="margin-top:5px;">
		<a href="javascript:void(0);" onclick="return downloadPhonebook();" class="reg">免费一键加好友</a>
		<?php if(!$user_id){ ?>
		<a href="index.php?m=shuafen&c=web&a=login" class="login">登录->别人加你</a>
		<?php }else{?>
		<a href="#" onclick="javascript:lineup();" class="login">被动加好友</a>
		<?php } ?>
    </div><!--login-reg/-->


    <div class="prolist">
     <div class="clearfix">
		 <?php foreach($infos as $v){ ?>
		 <div style="border-bottom : 1px dotted gray; margin: auto 10px;"><span style="float : right;margin-top:10px;">
			 <?php echo $v['nickname'] ?>&nbsp;&nbsp;
			 <?php echo $sex[$v['sex']] ?>&nbsp;&nbsp;开始时间&nbsp;&nbsp;
			 <?php echo date('Y-m-d H:i:s',$v['start_time']); ?></span>
			 <img class="img-circle" src="../../../../statics/shuafen/images/avatar/<?php echo $v['img']?>" width="45" height="45" style="margin-right: 15px;"><div style="clear:both;">
			 </div>
		 </div>
		 <?php } ?>
	 </div>
    </div><!--prolist/-->
    <div class="heights">&nbsp;</div>
	{template 'shuafen', 'footer'}
    <!-- 模态框（Modal） -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">提醒</h4>
				</div>
				<div class="modal-body" id="modelText"></div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭
					</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{SHUAFEN_STATICS_PATH}js/lib/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{SHUAFEN_STATICS_PATH}js/lib/bootstrap.min.js"></script>
    <script src="{SHUAFEN_STATICS_PATH}js/lib/style.js"></script>
    <!--轮播图特效-->
    <script src="{SHUAFEN_STATICS_PATH}js/lib/jquery.excoloSlider.js"></script>
    <style>
    .slider{max-width:640px;margin:0px auto; margin-top:5px;text-align:center;}
    </style>
    <script>
   $(function () {
	  //$('.ad').on("touchstart",function (){
			//    	window.location.href=$(this).attr("picUrl");
			  //  });
      $("#sliderA").excoloSlider();
	  $(".es-pager").hide();
	  //导航定位
	  $("nav dl:eq(0)").addClass("navCur");
    });
	//判断是否为微信浏览器
	function isWeiXin(){
		var ua = window.navigator.userAgent.toLowerCase();
		if(ua.match(/MicroMessenger/i) == 'micromessenger'){
			return true;
		}else{
			return false;
		}
	}
    //下载通迅录
    function downloadPhonebook(){
    	if(isWeiXin()){
    		$("#modelText").text("由于微信不支持下载文件操作，请您点击右上角菜单，选择在浏览器中打开！");
			$('#myModal').modal();
    		return false;
    	}else{
			window.location.href='/index.php?m=shuafen&c=web&a=free_add'
//    		$.ajax({
//    			url : 'http://www.udppvr.cn:80/profile/oneKeyDownload.do',
//				url : '/index.php?m=shuafen&c=web&a=free_add',
//				async : false,
//    			success : function (rs){
//    				if(rs.iserror) {
//    					$("#modelText").text(rs.message);
//    					$('#myModal').modal();
//    		    		return false;
//    				}else{
//    					window.location.href="http://www.udppvr.cn:80/static/vcf/"+rs.message;
//    				}
//    			},
//    			dataType : 'json'
//    		});
    	}
    }
    </script>
  </body>
</html>